package com.kuang.controller;

import com.kuang.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @ApiOperation("首页控制方法")
    @GetMapping({"/"})
    public String hello() {
        return "hello world";
    }

    //只要接口中返回值中存在实体类，它就会被扫描到swagger
    @PostMapping("/user")
    public User user(){
        return new User();
    }

    @ApiOperation("hello2测试方法")
    @GetMapping({"/hello2"})
    public String hello2( @ApiParam("用户名提示参数") String username) {
        return "hello world";
    }

}
